import { reqAddressInfo, reqTradeInfo } from "@/api"
const state={
  tradeInfo:{},
  addressInfo:[]
}
const mutations={
  GETADDRESSINFO(state,addressInfo){
    state.addressInfo=addressInfo
  },
  GETTRADEINFO(state,tradeInfo){
    state.tradeInfo=tradeInfo
  }
}
const actions={
  async getAddressInfo({commit}){
    let result=await reqAddressInfo()
    if(result.code==200){
      commit('GETADDRESSINFO',result.data)
    }
  },
  async getTradeInfo({commit}){
    let result=await reqTradeInfo()
    console.log(result)
    if(result.code==200){
      commit('GETTRADEINFO',result.data)
    }
  }
}
const getters={
}
export default{
  state,
  mutations,
  actions,
  getters
}